home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games 1996 July
/
Amiga Games 1996 #7.iso
/
archive
/
userbox
/
publicdomain
/
chunker.lha
/
Chunker
/
source
/
dechunk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-01
|
1KB
|
64 lines
/*************************************************************************
*
* DeChunker
*
* Copyright ©1995 Lee Kindness
* cs2lk@scms.rgu.ac.uk
*
* dechunk.c
*/
#include "dechunk.h"
/*************************************************************************
* main() - DaDDDaaah!
*/
int main(int argc, char **argv)
{
long ret = 10;
/* init */
if( InitSystem() )
{
struct Args *args;
if( args = GetDeChunkArgs(argc, argv) )
{
FILEt dest;
if( dest = mfopen(args->arg_Filename, FILEOPEN_WRITE) )
{
char *srcname;
long num = 0;
FILEt src;
while( (srcname = BuildFName(args->arg_Basename, &num)) &&
(src = mfopen(srcname, FILEOPEN_READ)) )
{
register int c;
mprintf("%s\n", srcname);
for( c = mfgetc(src);
c != EOF;
c = mfgetc(src) )
mfputc(c, dest);
FreeFName(srcname);
mfclose(src);
}
ret = 0;
mfclose(dest);
}
FreeDeChunkArgs(args);
}
FreeSystem();
}
return( ret );
}